package demo.feed4junit;

import util.JsonUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DemoFeed {

    public int add(int value1, int value2) {
        return value1 + value2;
    }


    public OutputObject method1(InputObject inputObject) {
        OutputObject outputObject = new OutputObject();
        //业务逻辑
        outputObject.setAge(inputObject.getAge());
        return outputObject;
    }

    public static void main(String[] args) {
        InputObject inputObject = new InputObject();
        inputObject.setAge(15);
        inputObject.setName("Tom");
        inputObject.setValue("10");

        List<ParaObect> paraObectList = new ArrayList<ParaObect>();
        ParaObect paraObect1 = new ParaObect();
        paraObect1.setName("Joker");
        paraObect1.setValue("11");

        ParaObect paraObect2 = new ParaObect();
        paraObect2.setName("King");
        paraObect2.setValue("13");
        paraObectList.add(paraObect1);
        paraObectList.add(paraObect2);

        inputObject.setParaObectList(paraObectList);

        Map<String, InputObject> inputMap = new HashMap<String, InputObject>();
        inputMap.put("1",inputObject);
        inputMap.put("2",inputObject);

        System.out.println(JsonUtils.toJson(inputMap));


        OutputObject outputObject = new OutputObject();
        outputObject.setAge(15);
        outputObject.setName("Tom");
        outputObject.setValue("10");



        outputObject.setParaObectList(paraObectList);

        Map<String, OutputObject> outputMap = new HashMap<String, OutputObject>();
        outputMap.put("1",outputObject);
        outputMap.put("2",outputObject);

        System.out.println(JsonUtils.toJson(outputMap));
    }

}
